<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改商城规格')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
         <form class="form-horizontal m" id="form-spec-edit" th:object="${shopAttr}">
            <input name="attrId" class="form-control" type="hidden" th:field="*{attrId}">
            <input name="attrType" class="form-control" type="hidden" th:field="*{attrType}">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">规格名称：</label>
                <div class="col-sm-8">
                    <input name="attrName" class="form-control" type="text" th:field="*{attrName}" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">规格值(多值以","分隔)：</label>
                <div class="col-sm-8">
                    <input name="attrValues" class="form-control" th:field="*{attrValues}" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">排序号：</label>
                <div class="col-sm-8">
                    <input name="sort" class="form-control" th:field="*{sort}" type="text" required>
                </div>
            </div>
        </form>
        
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "shop/attr"
        $("#form-spec-edit").validate({
            focusCleanup: true,
            onkeyup: false,
			rules:{
				sort:{
					digits:true
				}
			}
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-spec-edit').serialize());
            }
        }
    </script>
</body>
</html>